//
//  CornerView.m
//  Fireball
//
//  Created by 俞渊华 on 2017/12/23.
//  Copyright © 2017年 俞渊华. All rights reserved.
//

#import "CornerView.h"

@implementation CornerView

-(void)setRadius:(CGFloat)radius{
    _radius = radius;
}
-(void)setXm_corner:(UIRectCorner)xm_corner{
    _xm_corner = xm_corner;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    UIBezierPath *maskPath;
    maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:self.xm_corner cornerRadii:CGSizeMake(self.radius, self.radius)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = self.bounds;
    maskLayer.path = maskPath.CGPath;
    self.layer.mask = maskLayer;
    
}


@end
